/*************************************************************************
 *
 *  elksip - a multi-platform Sip Phone Server
 *
 *  file: elk_port.c
 *
 *  Copyright 2011-2013 Elksip team.
 *
 ************************************************************************/
#ifndef WIN32
#include<pthread.h>
#endif
#include"elk_port.h"

int elk_thread_create(void *(*start_routine) (void *), void *arg)
{
#ifndef WIN32
    pthread_t t;
    pthread_attr_t attr;
    pthread_attr_init(&attr);
    pthread_create( &t, &attr, (void*)start_routine, arg);
#else
//FIXME
    //printf("Not Implment!\n");
#endif
    return 0;
}

void elk_mutex_init(Elk_Mutex *mutex)
{
    pthread_mutex_init(&(mutex->mutex), NULL);
    return;
}

void elk_mutex_lock(Elk_Mutex *mutex)
{
    pthread_mutex_lock(&(mutex->mutex));
    return;
}
void elk_mutex_unlock(Elk_Mutex *mutex)
{
    pthread_mutex_unlock(&(mutex->mutex));
    return ;
}
